﻿<c:FriendsViewBase x:Class="nyxwin.Main.View.Main.FriendsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c="clr-namespace:nyxwin.Main.View.Main"
    xmlns:imagetools="clr-namespace:ImageTools.Controls;assembly=ImageTools.Controls"
    xmlns:lc="clr-namespace:nyxwin.Main.Controls"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">
    <c:FriendsViewBase.Resources>
        <imagetools:ImageConverter x:Key="imageConverter" />
        <Style TargetType="ListBox" x:Key="friendsListStyle">
            <Setter Property="ItemTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Margin="4">
                            <lc:NyxIcon Uri="{Binding NickImageUrl}" />
                            <!--<imagetools:AnimatedImage Source="{Binding NickImageUrl, Converter={StaticResource imageConverter}}" Width="56" Height="56" />-->
                            <StackPanel Orientation="Vertical">
                                <TextBlock Text="{Binding Nick}" Style="{StaticResource PhoneTextAccentStyle}" />
                                <StackPanel Orientation="Horizontal" Margin="0,0,0,0" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Visibility="{Binding Path=ActiveVisibility}">
                                    <TextBlock Text="{Binding Path=Active.LastActivityFormat}" Style="{StaticResource PhoneTextSubtleStyle}" FontSize="{StaticResource PhoneFontSizeSmall}" />
                                    <HyperlinkButton Content="{Binding Path=Active.Location}" Margin="-15,0,0,0" Padding="0,0,0,0" FontSize="{StaticResource PhoneFontSizeSmall}" Command="{Binding Path=Active.LocationCommand}" />
                                </StackPanel>
                            </StackPanel>
                        </StackPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled" />
        </Style>
    </c:FriendsViewBase.Resources>
    <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
        <StackPanel>
            <ListBox ItemsSource="{Binding Path=ActiveFriends}" Style="{StaticResource friendsListStyle}" />
            <Rectangle Height="2" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="12,10,12,10" Fill="{StaticResource PhoneAccentBrush}" />
            <ListBox ItemsSource="{Binding Path=NonActiveFriends}" Style="{StaticResource friendsListStyle}" />
        </StackPanel>
    </ScrollViewer>
</c:FriendsViewBase>
